package com.example.demo.util;

import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author ZhangKe
 * @Description
 * @date 2019/7/4 16:29.
 */
@Slf4j
@Component
@NoArgsConstructor
public class Verlify {

    /**
     * 判断是否是管理员
     *
     * @param request
     * @return
     */
    public boolean isAdmin(HttpServletRequest request){
        if (request.getSession().getAttribute("admin")!=null){
            return true;
        }else{
            return false;
        }
    }
}
